<a href="/photos/add">Add photo</a>

    <?
$photos = $this->photos;
?>

<table class="table4admin">
    <thead>
    <tr>
        <td >id</td>
        <td >Image</td>
        <td style="text-align: center;">Is publick</td>
        <td></td>
        <td></td>

    </tr>
    </thead>

    <tbody>

    <? foreach ($photos as $photo): ?>

    <tr>
        <td><?= $photo['id'] ?></td>
        <td ><? if (!empty($photo['src'])): ?>
            <a href="<?= $photo['src'] ?>"><img src="<?= $photo['src'] ?>" alt="Photo<?=$count;?>" style="width:120px"/></a>
            <? endif;?>
        </td>


       

        <td style="width:50px;text-align: center">
            <? $checked = $photo['ispublish'] ? "checked" : null ?>
            <input type="checkbox" class="checkit" <?= $checked ?> disabled="true"/>
        </td>

        <td style="width:50px; text-align: center;">
            <?if (isset($checked)):?>
                -
                <?else:?><a href="/photos/post/id/<?= $photo['id'] ?>" class="delete">Publish</a>
                <?endif;?>

        </td>
        <td style="width:50px;text-align: center"><a href="/photos/delete/id/<?= $photo['id'] ?>" class="delete">Delete</a></td>
    </tr>
       
        <? endforeach; ?>
    </tbody>
</table>



<?php echo $this->paginationControl($this->paginator, 'Sliding', 'photos/controls.phtml'); ?>